import { RouteRecordRaw } from 'vue-router'
import { RouterTransition } from '@/components/transition'
import { markRaw } from "vue";

const routeName = 'ums'

/**
 * 权限管理
 */
const routes: Array<RouteRecordRaw> = [
    {
        path: '/ums',
        name: routeName,
        redirect: '/ums/admin',
        component: markRaw(RouterTransition),
        meta: {
            title: '权限',
            icon: 'icon-zhuomian',
        },
        children: [
            {
                path: '/ums/admin',
                name: `${routeName}-admin`,
                meta: {
                    title: '用户列表',
                    icon: 'icon-zhuomian'
                },
                component: () => import('@/views/ums/admin/index.vue')
            },
            {
                path: '/ums/role',
                name: `${routeName}-role`,
                meta: {
                    title: '角色列表',
                    icon: 'icon-zhuomian'
                },
                component: () => import('@/views/ums/role/index.vue')
            },
            {
                path: '/ums/menu',
                name: `${routeName}-menu`,
                meta: {
                    title: '菜单列表',
                    icon: 'icon-zhuomian'
                },
                component: () => import('@/views/ums/menu/index.vue')
            },
            {
                path: '/ums/resource',
                name: `${routeName}-resource`,
                meta: {
                    title: '资源列表',
                    icon: 'icon-zhuomian'
                },
                component: () => import('@/views/ums/resource/index.vue')
            },
        ]
    }
]

export default routes
